class WeeklyZerosSyn < ActiveRecord::Migration
  def self.up
    puts time = Time.now
=begin
    while true do
      results = WeeklyResult.all :conditions => "clicks = 0 and comments = 0 and (stows = 0 or stows is null) " +
                                                                 "and (danmu = 0 or danmu is null) and (yb = 0 or yb is null) and (tj = 0 or tj is null)",
                                 :limit => 2500, :order => "id"
      puts "get #{results.first.id} to #{results.last.id}. use #{Time.now - time} sec."
	    break if results.empty?
      WeeklyResult.transaction do
        results.each do |result|
          WeeklyZero
        end
      end
    end
=end
  end

  def self.down
  end
end
